<?php
	class CheckareaAction extends BaseAction{
	
		public function index(){
			if(!$_SESSION['xids']==''){
					if($_POST['fun']='quyu'){
						$a_id = $_POST['a_id'];
						$result =M("xiezilou")->where("x_quyu=$a_id")->select();
					}elseif($_POST['fun']=='zongjia'){
						$zongjia = $_POST['money'];
						$money = explode("-",$zongjia);
						$result = M("xiezilou")->where("x_sell>=$money[0] and x_sell<=$money[1]")->select();
					}elseif($_POST['fun']=='subway'){
						$subway = $_POST['subway'];	
						$result = M("xiezilou")->where("x_subway=$subway")->select();			
					}elseif($_POST['fun']=='type'){
						$type = $_POST['type'];
						$result = M("xiezilou")->where("x_type=$type")->select();
					}elseif($_POST['fun']=='rent'){
						$rent = $_POST['rent'];
						$lists = M("xiezilou")->where("x_zulin=$rent")->select();
					}
					foreach($result as $key=>$value){
						$data[] = $value['x_id'];
					}
					$xids = implode(",",$data);
					$_SESSION['xids'] = $xids;
				}else{
					if($_POST['fun'] == 'quyu'){
						$a_id = $_POST['a_id'];
						$result =M("xiezilou")->where("x_quyu=$a_id and x_id in (".$_SESSION['xids'].")")->select();
					}elseif($_POST['fun']=='zongjia'){
						$zongjia = $_POST['money'];
						$money = explode("-",$zongjia);
						$result = M("xiezilou")->where("x_sell>=$money[0] and x_sell<=$money[1] and x_id in (".$_SESSION['xids'].")")->select();
					}elseif($_POST['fun']=='subway'){
						$subway = $_POST['subway'];	
						$result = M("xiezilou")->where("x_subway=$subway and x_id in (".$_SESSION['xids'].")")->select();
					}elseif($_POST['fun']=='type'){
						$type = $_POST['type'];
						$result = M("xiezilou")->where("x_type=$type and x_id in (".$_SESSION['xids'].")")->select();
					}elseif($_POST['fun']=='rent'){
						$rent = $_POST['rent'];
						$result = M("xiezilou")->where("x_zulin=$rent and x_id in (".$_SESSION['xids'].")")->select();
					}
					foreach($result as $key=>$value){
						$data[] = $value['x_id'];
					}
					$xids = implode(",",$data);
					$_SESSION['xids'] = $xids;
				}
				
		
		}
	
	
	
	
	}
	

?>